﻿@using GoodMan.Infrastructure.Entities.Entity;
@{
    ViewBag.Title = "商户信息";
    Layout = "~/Areas/WorkSpace/Views/Shared/_CollegeAdminTemplete.cshtml";
    ItemListBox<Business> list = ViewBag.BusinessList;
}

<div id="content-header">
    <h1>
        商户信息</h1>
</div>
<div id="breadcrumb">
    <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>
        首页</a> <a href="/workspace/collegeadmin/BusinessInfoList" class="tip-bottom">商户管理</a>
    <a href="/workspace/collegeadmin/BusinessInfoList" class="current">信息列表</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <h5>
                        信息列表</h5>
                </div>
                <br />
                <form action="/workspace/collegeadmin/Businessinfolist" method="get" name="BusinessForm">
                <div style="width: 500px; margin: 0px auto;">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr align="center">
                            
                            <td width="100px">
                                查询关键字
                            </td>
                            <td width="20%">
                                <input type="text" placeholder="输入电话号码或商户名" name="search" value="@ViewBag.Search"  style="width: 200px" class="span4 " />
                            </td>
                            
                            <td>
                                <button type="submit" class="btn btn-primary">
                                    查询</button>
                            </td>
                        </tr>
                    </table>
                </div>
                </form>
                <div class="widget-content nopadding">
                    <table class="table table-bordered data-table">
                        <thead>
                            <tr>
                                <th width="3%">
                                    序号
                                </th>
                                <th width="8%">
                                    商户名
                                </th>                                
                                <th width="8%">
                                    联系方式
                                </th>
                                
                                <th width="10%">
                                    主营
                                </th>  
                                <th width="10%">
                                    送餐时间
                                </th>                                
                                <th width="10%">
                                    地址
                                </th>
                                                          
                                <th width="8%">
                                    特色菜
                                </th>                                
                                                               
                                <th width="16%">
                                    星级
                                </th>
                                <th width="10%">
                                    创建信息
                                </th>
                                <th width="10%">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                if (list != null && list.Data != null && list.Data.Count != 0)
                                {
                                    int index = 0;
                                    foreach (var item in list.Data)
                                    {
                                        index++;
                                        
                                <tr class="gradeX">
                                    <td style="width: 10px;">@index
                                    </td>                                    
                                    <td>
                                        <a href="/workspace/collegeadmin/BusinessInfo?d=@item.Id&page=@list.CurrentPage" title="查看详细">@item.Name</a>
                                    </td>
                                    <td><span title="@item.ContactInfo">@item.ContactInfo</span>
                                    </td>
                                    <td><span title="@item.MainSell">@item.MainSell</span></td>
                                   
                                    <td>
                                    @{
                                        string[] startTimeArr = item.DeliveryTime.Split('|');
                                        string[] endTimeArr = item.DeliveryTimeEnd.Split('|');

                              if (startTimeArr != null && startTimeArr.Length != 0)
                              {
                                  for (int i = 0; i < startTimeArr.Length; i++)
                                  {
                                      <span>@startTimeArr[i]~@endTimeArr[i]</span><br />
                                  }
                              }
                                }
                                    </td>
                                    <td><span title="@item.Address">@item.Address</span></td>
                                    <td><span title="@item.SpecialFood">@item.SpecialFood</span></td>
                                   
                                    <td>
                                    @{
                                        item.Levels=item.Levels==0?1:item.Levels;
                                        for (int i = 0; i < @item.Levels; i++)
                                        {
                                    <img src="/Content/img/star.png" />                                            
                                        }
                                        }
                                    </td>
                                    <td>
                                        <span title="创建人：@item.Creator">@item.CreateDate.ToShortDateString()</span>
                                                                                
                                    </td>                                    
                                    <td class="center" style="min-width: 200px;">
                                        @{
                                             <a href="/workspace/collegeadmin/modifyBusiness?d=@item.Id&page=@list.CurrentPage" class="btn btn-primary btn-mini">
                                                    编辑</a> <a href="/workspace/collegeadmin/delBusiness?d=@item.Id&page=@list.CurrentPage"  onclick="if (confirm('确认删除数据？删除后该数据无法恢复！')==true){return true;}else{return false;}"  class="btn btn-danger btn-mini">
                                                        删除</a>
                                          
                                        }
                                    </td>
                                </tr>
                                    }

                                }
                                else
                                {
                                <tr>
                                    <td style="width: 10px;" colspan="10" align="center">
                                        <span>没有找到任何数据</span>
                                    </td>
                                </tr>
                                }
                            }
                        </tbody>
                    </table>
                </div>
                @Html.Raw(list.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript">
        $(function () {
            $('#likBusiness').addClass('open');
            $('#likBusiness').addClass('active');
        });
    </script>
}

